home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / jpegsrc4.zip / SETUP < prev    next >
Text File  |  1992-12-08  |  27KB  |  523 lines

  1. SETUP instructions for the Independent JPEG Group's JPEG software
  2. =================================================================
  3.  
  4. This file explains how to configure and compile the JPEG software.  We have
  5. tried to make this software extremely portable and flexible, so that it can be
  6. adapted to almost any environment.  The downside of this decision is that the
  7. installation process is not very automatic; you will need at least a little
  8. familiarity with C programming and program build procedures for your system.
  9.  
  10. This file contains general instructions, then sections of specific hints for
  11. certain systems.  You may save yourself considerable time if you scan the
  12. whole file before starting to do anything.
  13.  
  14. Before installing the software you must unpack the distributed source code.
  15. Since you are reading this file, you have probably already succeeded in this
  16. task.  However, there is one potential trap if you are on a non-Unix system:
  17. you may need to convert these files to the local standard text file format
  18. (for example, if you are on MS-DOS you probably have to convert LF end-of-line
  19. to CR/LF).  If so, apply the conversion to all the files EXCEPT those whose
  20. names begin with "test".  The test files contain binary data; if you change
  21. them in any way then the self-test will give bad results.
  22.  
  23.  
  24. STEP 1: PREPARE A MAKEFILE
  25. ==========================
  26.  
  27. First, select a makefile and copy it to "Makefile" (or whatever your version
  28. of make uses as the default makefile name; for example, "makefile.mak" for
  29. old versions of Borland C).  We include several standard makefiles in the
  30. distribution:
  31.  
  32.     makefile.ansi:    for Unix systems with ANSI-compatible C compilers.
  33.     makefile.unix:    for Unix systems with non-ANSI C compilers.
  34.     makefile.mc5:    for Microsoft C 5.x under MS-DOS.
  35.     makefile.mc6:    for Microsoft C 6.x and up under MS-DOS.
  36.     makefile.bcc:    for Borland C (Turbo C) under MS-DOS.
  37.     makefile.manx:    for Manx Aztec C on Amigas.
  38.     makefile.sas:    for SAS C on Amigas.
  39.     makcjpeg.st:    project file for Atari ST/STE/TT Pure C or Turbo C.
  40.     makdjpeg.st:    project file for Atari ST/STE/TT Pure C or Turbo C.
  41.     makljpeg.st:    project file for Atari ST/STE/TT Pure C or Turbo C.
  42.     makefile.mms:    for VAX/VMS systems with MMS.
  43.     makefile.vms:    for VAX/VMS systems without MMS.
  44.  
  45. If you don't see a makefile for your system, we recommend starting from either
  46. makefile.ansi or makefile.unix, depending on whether your compiler accepts
  47. ANSI C or not.  Actually you should start with makefile.ansi whenever your
  48. compiler supports ANSI-style function definitions; you don't need full ANSI
  49. compatibility.  The difference between the two makefiles is that makefile.unix
  50. preprocesses the source code to convert function definitions to old-style C.
  51. (Our thanks to Peter Deutsch of Aladdin Enterprises for the ansi2knr program.)
  52.  
  53. If you don't know whether your compiler supports ANSI-style function
  54. definitions, then take a look at ckconfig.c.  It is a test program that will
  55. help you figure out this fact, as well as some other facts you'll need in
  56. later steps.  You must compile and execute ckconfig.c by hand; the makefiles
  57. don't provide any support for this.  ckconfig.c may not compile the first try
  58. (in fact, the whole idea is for it to fail if anything is going to).  If you
  59. get compile errors, fix them by editing ckconfig.c according to the directions
  60. given in ckconfig.c.  Once you get it to run, select a makefile according to
  61. the advice it prints out, and make any other changes it recommends.
  62.  
  63. Look over the selected Makefile and adjust options as needed.  In particular
  64. you may want to change the CC and CFLAGS definitions.  For instance, if you
  65. are using GCC, set CC=gcc.  If you had to use any compiler switches to get
  66. ckconfig.c to work, make sure the same switches are in CFLAGS.
  67.  
  68. If you are on a system that doesn't use makefiles, you'll need to set up
  69. project files (or whatever you do use) to compile all the source files and
  70. link them into executable files cjpeg and djpeg.  See the file lists in any of
  71. the makefiles to find out which files go into each program.  As a last resort,
  72. you can make a batch script that just compiles everything and links it all
  73. together; makefile.vms is an example of this (it's for VMS systems that have
  74. no make-like utility).
  75.  
  76.  
  77. STEP 2: EDIT JCONFIG.H
  78. ======================
  79.  
  80. Look over jconfig.h and adjust #defines to reflect the properties of your
  81. system and C compiler.  If you prefer, you can usually leave jconfig.h
  82. unmodified and add -Dsymbol switches to the Makefile's CFLAGS definition.
  83. (This is already done if you used a compiler-specific makefile in step 1.)
  84. However, putting the switches in the Makefile is a bad idea if you are going
  85. to incorporate the JPEG software into other programs --- you'd need to include
  86. the same -D switches in the other programs' Makefiles.  Better to change
  87. jconfig.h.
  88.  
  89. If you have an ANSI-compliant C compiler, no changes should be necessary
  90. except perhaps for RIGHT_SHIFT_IS_UNSIGNED and TWO_FILE_COMMANDLINE.  For
  91. older compilers other changes may be needed, depending on what ANSI features
  92. are supported.
  93.  
  94. If you don't know enough about C programming to understand the questions in
  95. jconfig.h, then use ckconfig.c to figure out what to change.  (See description
  96. of ckconfig.c in step 1.)
  97.  
  98. A note about TWO_FILE_COMMANDLINE: defining this selects the command line
  99. syntax in which the input and output files are both named on the command line.
  100. If it's not defined, the output image goes to standard output, and the input
  101. can optionally come from standard input.  You MUST use two-file style on any
  102. system that doesn't cope well with binary data fed through stdin/stdout; this
  103. is true for most MS-DOS compilers, for example.  If you're not on a Unix
  104. system, it's probably safest to assume you need two-file style.
  105.  
  106.  
  107. STEP 3: SELECT SYSTEM-DEPENDENT FILES
  108. =====================================
  109.  
  110. A few places in the JPEG software are so system-dependent that we have to
  111. provide several different implementations and let you select the one you need.
  112.  
  113. The only system-dependent file in the current version is jmemsys.c.  This file
  114. controls use of temporary files for big images that won't fit in main memory.
  115. You'll notice there is no file named jmemsys.c in the distribution; you must
  116. select one of the provided versions and copy, rename, or link it to jmemsys.c.
  117. Here are the provided versions:
  118.  
  119.     jmemansi.c    This is a reasonably portable version that should
  120.             work on most ANSI and near-ANSI C compilers.  It uses
  121.             the ANSI-standard library routine tmpfile(), which not
  122.             all non-ANSI systems have.  On some systems tmpfile()
  123.             may put the temporary file in a non-optimal location;
  124.             if you don't like what it does, use jmemname.c.
  125.  
  126.     jmemname.c    This version constructs the temp file name by itself.
  127.             For anything except a Unix machine, you'll need to
  128.             configure the select_file_name() routine appropriately;
  129.             see the comments near the head of jmemname.c.
  130.             If you use this version, define NEED_SIGNAL_CATCHER
  131.             in jconfig.h or in the Makefile to make sure the temp
  132.             files are removed if the program is aborted.
  133.  
  134.     jmemnobs.c    (That stands for No Backing Store :-).  This will
  135.             compile on almost any system, but it assumes you
  136.             have enough main memory or virtual memory to hold
  137.             the biggest images you need to work with.
  138.  
  139.     jmemdos.c    This should be used in most MS-DOS installations; see
  140.             the system-specific notes about MS-DOS for more info.
  141.             IMPORTANT: if you use this, also copy jmemdos.h to
  142.             jmemsys.h, replacing the standard version.  ALSO,
  143.             include the assembly file jmemdosa.asm in the programs.
  144.             (This last is already done if you used one of the
  145.             supplied MS-DOS-specific makefiles.)
  146.  
  147. If you have plenty of (real or virtual) main memory, just use jmemnobs.c.
  148. "Plenty" means at least ten bytes for every pixel in the largest images
  149. you plan to process, so a lot of systems don't meet this criterion.
  150. If yours doesn't, try jmemansi.c first.  If that doesn't compile, you'll have
  151. to use jmemname.c; be sure to adjust select_file_name() for l